import { ref } from 'vue'
import { defineStore } from "pinia"

export const useFactoryStore = defineStore('homeFactory', () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  return { isShow, show, hidden, data, setData, getData }
})

export const useBrandStore = defineStore('homeBrand', () => {
  const isShow = ref(false)
  const data = ref([])
  const type = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  function setType(param) {
    type.value = param
  }

  function getType() {
    return type.value
  }

  return { isShow, data, type, show, hidden, setData, getData, setType, getType }
})

export const useModelStore = defineStore('homeModel', () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param ? param : []
  }

  function getData() {
    return data.value
  }

  return { isShow, data, show, hidden, setData, getData }
})

export const useWarehousingStore = defineStore('homeWarehousing', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useEmployeeStore = defineStore('homeEmployee', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useCompletedStore = defineStore('homeCompleted', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useProportionStore = defineStore('homeProportion', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useProgressStore = defineStore('homeProgress', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})